package cn.tedu._04mybatis.mapper;

import cn.tedu._04mybatis.pojo.entity.Weibo;
import cn.tedu._04mybatis.pojo.vo.ResultMapVO1;
import cn.tedu._04mybatis.pojo.vo.ResultMapVO2;
import cn.tedu._04mybatis.pojo.vo.WeiboVO2;
import cn.tedu._04mybatis.pojo.vo.WeiboVo1;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WeiboMapper {
//    @Insert("INSERT INTO weibo(content,created,user_id) VALUES (#{content},#{created},#{userId})")
    int insertWeibo(Weibo weibo);

//    @Delete("DELETE FROM weibo WHERE id=#{wid}")
    int deleteWeiboById(Long wid);

//    @Update("UPDATE weibo SET content=#{content},created=#{created},user_id=#{userId} WHERE id=#{id}")
    int updateWeiboById(Weibo weibo);

//    @Select("SELECT id,content,created,user_id userId FROM weibo WHERE id=#{wid}")
    Weibo selectWeiboById(Long wid);
//    @Select("SELECT content,created  FROM weibo WHERE id=#{wid}")
    WeiboVo1 selectWeiboVOById(Long wid);

//    @Select("SELECT id wid,content FROM weibo WHERE user_id=#{userId}")
    List <WeiboVO2> selectWeiboVO2ById(Long userId);

    int deleteWeiboVOByIds1(Integer[] ids);

    int deleteWeiboVOByIds2(List<Integer> ids);

    int dynamicUpdatetWeiboById(Weibo weibo);

    int selectCount();

    ResultMapVO1 selectMap1(Long wid);

    ResultMapVO2 selectMap2(Long uid);
}
